{extend name=".././view/create.html" /}
{block name="jscss"}
{/block}
{block name="form"}
<div class="layui-form-item" align="center">
	{eq name="$list.set.formpost" value="PUT" }
	{if strlen($list.data.jtpic)>0}
	<img id="img" style="max-height: 300px;max-width: 500px" src="__UPLOAD__/{$list.data.jtpic}" onclick="imgMax(this,true)">
	{else /}
	<img id="img" style="max-height: 300px;max-width: 500px" src="__UPLOAD__/rongyu_teacher/404.png" onclick="imgMax(this,true)">
	{/if}
	{/eq}
</div>
<form class="layui-form layui-form-pane" lay-filter="myform">
	<div class="layui-form-item">
		<label for="title" class="layui-form-label">
			图片
		</label>
		<div class="layui-inline">
			<div class="layui-input-inline" style="min-width: 300px">
				<input type="text" id="jtpic" name="jtpic" autocomplete="off" class="layui-input " value="{$list.data.jtpic|default=''}" placeholder="地址" readonly>
			</div>
			<div class="layui-input-inline" style="min-width: 100px">
				<button type="button" class="layui-btn" id="upload">
					<i class="layui-icon">&#xe67c;</i>上传图片
				</button>
			</div>
		</div>
	</div>
	<div class="layui-form-item">
		<label for="bianhao" class="layui-form-label">
			编号标题
		</label>
		<div class="layui-input-block">
			<input class="layui-input" type="text" value="{$list.data.bianhao|default=''}  {$list.data.title|default=''}" placeholder="课题编号" disabled>
		</div>
	</div>
	<div class="layui-form-item">
		<label for="teacher_name" class="layui-form-label">
			主持人
		</label>
		<div class="layui-input-block" id="teacher_id" school_id="">
		</div>
	</div>
	<div class="layui-form-item">
		<label for="canyu_name" class="layui-form-label">
			参与人
		</label>
		<div class="layui-input-block" id="canyu_id" school_id="">
		</div>
	</div>
	<div class="layui-form-item">
		<label for="jddengji_id" class="layui-form-label" style="height: 100%">
			<span class="x-red">*</span>结题鉴定
		</label>
		<div class="layui-input-block">
			<select name="jddengji_id" id="jddengji_id">
			</select>
		</div>
	</div>
	<div class="layui-form-item">
		<label for="beizhu" class="layui-form-label">
			备注
		</label>
		<div class="layui-input-block">
			<input type="text" id="beizhu" name="beizhu" autocomplete="off" class="layui-input " value="{$list.data.beizhu|default=''}" placeholder="填写流失原因等情况">
		</div>
	</div>
	<div class="layui-form-item" style="text-align: right;">
		<button class="layui-btn" lay-filter="mysubmit" lay-submit="">
			{$list.set.butname}
		</button>
	</div>
</form>
{/block}
{block name="myjs"}
<script>
// 日期控件
layui.use(['laydate', 'mytable', 'createInput'], function() {
	var laydate = layui.laydate,
		mytable = layui.mytable,
		cInput = layui.createInput;

	cInput.categorySelect('jddengji_id', 118, "{$list.data.jddengji_id|default=''}");

	//执行一个laydate实例
	laydate.render({
		elem: '#jtshijian' //指定元素
			,
		trigger: 'click' //采用click弹出
	});

	cInput.uploadPic('upload', "/rongyu/danwei/upload", '课题', 'keti\\jieti', 'jtpic');

	// 搜索教师
	xmselectzc = cInput.searchTeacher('teacher_id');
	xmselectcy = cInput.searchTeacher('canyu_id');

	// 添加已有表单值
	formpost = "{$list.set.formpost|default=''}".toLocaleUpperCase();
	if (formpost == 'PUT') {
		data = {
			ketiinfo_id: "{$list.data.id}",
			category_id: 11901
		}
		cInput.loadTeacher(xmselectzc, '/keti/info/srccy', data);
		data.category_id = 11902;
		cInput.loadTeacher(xmselectcy, '/keti/info/srccy', data);
	}

	// 图片放大
	$('#img').click(function(){
	  cInput.imgMax(this);
	})

});

</script>
{/block}
